import Vue from 'vue'
import App from './App.vue'
import axios from 'axios'
import { Switch, Pagination, Uploader, Search,Loading, Button, Tab, Tabs,Field, Badge,NoticeBar, Empty,Cell, Checkbox, CellGroup, Toast, Notify, Stepper, RadioGroup, Icon,Radio, Tag, Dialog, Popup  } from 'vant'
// 全局注册
Vue.use(Switch);
Vue.use(Pagination);
Vue.use(Uploader);
Vue.use(Loading);
Vue.use(Search);
Vue.use(Notify);
Vue.use(Checkbox);
Vue.use(Toast);
Vue.use(Icon);
Vue.use(Badge);
Vue.use(Dialog);
Vue.use(NoticeBar);
Vue.use(Empty);
Vue.use(Popup);
Vue.use(Tag);
Vue.use(Stepper);
Vue.use(Radio);
Vue.use(RadioGroup);
Vue.use(Cell);
Vue.use(CellGroup);
Vue.use(Field);
Vue.use(Tab);
Vue.use(Tabs);
Vue.use(Button)
Vue.prototype.$axios = axios
const getItem = (type) => {
    return new Promise(resolve => {
        chrome.storage.local.get(type, (res) => {
            resolve(res[type])
        })
    })
}
const setItem = (data) => {
    chrome.storage.local.set(data)
}
Vue.prototype.$getItem = getItem
Vue.prototype.$setItem = setItem
new Vue({
    el: '#popup',
    render: h => h(App)
})
